/*
 * Powered By [rapid-framework]
 * Web Site: http://www.rapid-framework.org.cn
 * Google Code: http://code.google.com/p/rapid-framework/
 * Since 2008 - 2019
 */

package net.dreamlu.db.qo;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.Date;
import javax.persistence.criteria.CriteriaBuilder;
import javax.persistence.criteria.Predicate;
import javax.persistence.criteria.Root;
import javax.persistence.criteria.Expression;
import javax.persistence.criteria.Order;

import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;
import org.hibernate.criterion.MatchMode;
import org.springframework.data.jpa.domain.Specification;
import net.dreamlu.db.po.*;
/**
 *
 * @author lambert.wang email:lambert.wang(a)crediteyes.com
 * @version 1.0
 * @since 1.0
 */
public class SysLogQuery extends SysLog implements Serializable {
    private static final long serialVersionUID = 3148176768559230877L;
    

	/** 主键id */
	private java.lang.Integer id;	
	private java.lang.Integer notEqId;	
	/** 登陆名 */
	private String likeUsernameWithStart;
	private String likeUsernameWithEnd;
	private String likeUsernameWithExact;
	private String likeUsernameWithAnywhere;
	private java.lang.String username;	
	private java.lang.String notEqUsername;	
	/** 角色名 */
	private String likeRoleNameWithStart;
	private String likeRoleNameWithEnd;
	private String likeRoleNameWithExact;
	private String likeRoleNameWithAnywhere;
	private java.lang.String roleName;	
	private java.lang.String notEqRoleName;	
	/** 操作 */
	private String likeOperationWithStart;
	private String likeOperationWithEnd;
	private String likeOperationWithExact;
	private String likeOperationWithAnywhere;
	private java.lang.String operation;	
	private java.lang.String notEqOperation;	
	/** 类-方法 */
	private String likeClassMethodWithStart;
	private String likeClassMethodWithEnd;
	private String likeClassMethodWithExact;
	private String likeClassMethodWithAnywhere;
	private java.lang.String classMethod;	
	private java.lang.String notEqClassMethod;	
	/** 内容 */
	private String likeContentWithStart;
	private String likeContentWithEnd;
	private String likeContentWithExact;
	private String likeContentWithAnywhere;
	private java.lang.String content;	
	private java.lang.String notEqContent;	
	/** 客户端ip */
	private String likeClientIpWithStart;
	private String likeClientIpWithEnd;
	private String likeClientIpWithExact;
	private String likeClientIpWithAnywhere;
	private java.lang.String clientIp;	
	private java.lang.String notEqClientIp;	
	/** 创建时间 */
	private java.time.LocalDateTime createTimeBegin;
	private java.time.LocalDateTime createTimeEnd;	
	private java.time.LocalDateTime createTime;	
	private java.time.LocalDateTime notEqCreateTime;	
	
	/*********** 系统属性，自动赋值 *********/
	private boolean isId;
	private boolean isNotEqId;
	private MatchMode likeusername;
	private boolean isUsername;
	private boolean isNotEqUsername;
	private MatchMode likeroleName;
	private boolean isRoleName;
	private boolean isNotEqRoleName;
	private MatchMode likeoperation;
	private boolean isOperation;
	private boolean isNotEqOperation;
	private MatchMode likeclassMethod;
	private boolean isClassMethod;
	private boolean isNotEqClassMethod;
	private MatchMode likecontent;
	private boolean isContent;
	private boolean isNotEqContent;
	private MatchMode likeclientIp;
	private boolean isClientIp;
	private boolean isNotEqClientIp;
	private boolean isCreateTimeBegin;
	private boolean isCreateTimeEnd;
	private boolean isCreateTime;
	private boolean isNotEqCreateTime;
	private java.lang.Integer ltCriterionId;
	public void setLtId(java.lang.Integer id){
		ltCriterionId = id;
	}
	public java.lang.Integer getLtId(){
		return ltCriterionId;
	}
	private java.lang.Integer leCriterionId;
	public void setLeId(java.lang.Integer id){
		leCriterionId = id;
	}
	public java.lang.Integer getLeId(){
		return leCriterionId;
	}
	private java.lang.Integer gtCriterionId;
	public void setGtId(java.lang.Integer id){
		gtCriterionId = id;
	}
	public java.lang.Integer getGtId(){
		return gtCriterionId;
	}
	private java.lang.Integer geCriterionId;
	public void setGeId(java.lang.Integer id){
		geCriterionId = id;
	}
	public java.lang.Integer getGeId(){
		return geCriterionId;
	}
	public java.lang.Integer getId() {
		return this.id;
	}
	
	public void setId(java.lang.Integer value) {		
		this.id = value;
		this.isId = true;
	}
	public boolean hasId() {
		return this.isId;
	}
	public java.lang.Integer getNotEqId() {
		return this.notEqId;
	}
	public void setNotEqId(java.lang.Integer id) {
		this.notEqId = id;
		this.isNotEqId = true;
	}
	public boolean hasNotEqId() {
		return this.isNotEqId;
	}
	// IN or notIN
	private List<java.lang.Integer>	inCriterionId;
	private List<java.lang.Integer>	notInCriterionId;
	public void setInId(boolean isIn,List<java.lang.Integer> ids){
		if(isIn){
			inCriterionId = ids;
		}else{
			notInCriterionId = ids;
		}
	}
	public List<java.lang.Integer> getInId() {
		return inCriterionId;
	}
	public List<java.lang.Integer> getNotInId() {
		return notInCriterionId;
	}
	
	//Null or NotNull
	private Boolean nullCriterionId;
	public void setNullId(boolean isNull){
			nullCriterionId = isNull;
	}
	public Boolean getNullId(){
		return nullCriterionId;
	} 
	
	public MatchMode getLikeUsername() {
		return this.likeusername;
	}
	public String getLikeUsernameWithStart() {
		return this.likeUsernameWithStart;
	}
	public void setLikeUsernameWithStart(String username) {	
		setUsername(username);
		setLikeUsername(MatchMode.START);
	}
	public String getLikeUsernameWithEnd() {
		return this.likeUsernameWithEnd;
	}
	public void setLikeUsernameWithEnd(String username) {	
		setUsername(username);
		setLikeUsername(MatchMode.END);
	}
	public String getLikeUsernameWithExact() {
		return this.likeUsernameWithExact;
	}
	public void setLikeUsernameWithExact(String username) {	
		setUsername(username);
		setLikeUsername(MatchMode.EXACT);
	}
	public String getLikeUsernameWithAnywhere() {
		return this.likeUsernameWithAnywhere;
	}
	public void setLikeUsernameWithAnywhere(String username) {	
		setUsername(username);
		setLikeUsername(MatchMode.ANYWHERE);
	}
	private void setLikeUsername(MatchMode matchMode) {		
		this.likeusername = matchMode;
	}
	public java.lang.String getUsername() {
		return this.username;
	}
	
	public void setUsername(java.lang.String value) {		
		this.username = value;
		this.isUsername = true;
	}
	public boolean hasUsername() {
		return this.isUsername;
	}
	public java.lang.String getNotEqUsername() {
		return this.notEqUsername;
	}
	public void setNotEqUsername(java.lang.String username) {
		this.notEqUsername = username;
		this.isNotEqUsername = true;
	}
	public boolean hasNotEqUsername() {
		return this.isNotEqUsername;
	}
	// IN or notIN
	private List<java.lang.String>	inCriterionUsername;
	private List<java.lang.String>	notInCriterionUsername;
	public void setInUsername(boolean isIn,List<java.lang.String> usernames){
		if(isIn){
			inCriterionUsername = usernames;
		}else{
			notInCriterionUsername = usernames;
		}
	}
	public List<java.lang.String> getInUsername() {
		return inCriterionUsername;
	}
	public List<java.lang.String> getNotInUsername() {
		return notInCriterionUsername;
	}
	
	//Null or NotNull
	private Boolean nullCriterionUsername;
	public void setNullUsername(boolean isNull){
			nullCriterionUsername = isNull;
	}
	public Boolean getNullUsername(){
		return nullCriterionUsername;
	} 
	
	public MatchMode getLikeRoleName() {
		return this.likeroleName;
	}
	public String getLikeRoleNameWithStart() {
		return this.likeRoleNameWithStart;
	}
	public void setLikeRoleNameWithStart(String roleName) {	
		setRoleName(roleName);
		setLikeRoleName(MatchMode.START);
	}
	public String getLikeRoleNameWithEnd() {
		return this.likeRoleNameWithEnd;
	}
	public void setLikeRoleNameWithEnd(String roleName) {	
		setRoleName(roleName);
		setLikeRoleName(MatchMode.END);
	}
	public String getLikeRoleNameWithExact() {
		return this.likeRoleNameWithExact;
	}
	public void setLikeRoleNameWithExact(String roleName) {	
		setRoleName(roleName);
		setLikeRoleName(MatchMode.EXACT);
	}
	public String getLikeRoleNameWithAnywhere() {
		return this.likeRoleNameWithAnywhere;
	}
	public void setLikeRoleNameWithAnywhere(String roleName) {	
		setRoleName(roleName);
		setLikeRoleName(MatchMode.ANYWHERE);
	}
	private void setLikeRoleName(MatchMode matchMode) {		
		this.likeroleName = matchMode;
	}
	public java.lang.String getRoleName() {
		return this.roleName;
	}
	
	public void setRoleName(java.lang.String value) {		
		this.roleName = value;
		this.isRoleName = true;
	}
	public boolean hasRoleName() {
		return this.isRoleName;
	}
	public java.lang.String getNotEqRoleName() {
		return this.notEqRoleName;
	}
	public void setNotEqRoleName(java.lang.String roleName) {
		this.notEqRoleName = roleName;
		this.isNotEqRoleName = true;
	}
	public boolean hasNotEqRoleName() {
		return this.isNotEqRoleName;
	}
	// IN or notIN
	private List<java.lang.String>	inCriterionRoleName;
	private List<java.lang.String>	notInCriterionRoleName;
	public void setInRoleName(boolean isIn,List<java.lang.String> roleNames){
		if(isIn){
			inCriterionRoleName = roleNames;
		}else{
			notInCriterionRoleName = roleNames;
		}
	}
	public List<java.lang.String> getInRoleName() {
		return inCriterionRoleName;
	}
	public List<java.lang.String> getNotInRoleName() {
		return notInCriterionRoleName;
	}
	
	//Null or NotNull
	private Boolean nullCriterionRoleName;
	public void setNullRoleName(boolean isNull){
			nullCriterionRoleName = isNull;
	}
	public Boolean getNullRoleName(){
		return nullCriterionRoleName;
	} 
	
	public MatchMode getLikeOperation() {
		return this.likeoperation;
	}
	public String getLikeOperationWithStart() {
		return this.likeOperationWithStart;
	}
	public void setLikeOperationWithStart(String operation) {	
		setOperation(operation);
		setLikeOperation(MatchMode.START);
	}
	public String getLikeOperationWithEnd() {
		return this.likeOperationWithEnd;
	}
	public void setLikeOperationWithEnd(String operation) {	
		setOperation(operation);
		setLikeOperation(MatchMode.END);
	}
	public String getLikeOperationWithExact() {
		return this.likeOperationWithExact;
	}
	public void setLikeOperationWithExact(String operation) {	
		setOperation(operation);
		setLikeOperation(MatchMode.EXACT);
	}
	public String getLikeOperationWithAnywhere() {
		return this.likeOperationWithAnywhere;
	}
	public void setLikeOperationWithAnywhere(String operation) {	
		setOperation(operation);
		setLikeOperation(MatchMode.ANYWHERE);
	}
	private void setLikeOperation(MatchMode matchMode) {		
		this.likeoperation = matchMode;
	}
	public java.lang.String getOperation() {
		return this.operation;
	}
	
	public void setOperation(java.lang.String value) {		
		this.operation = value;
		this.isOperation = true;
	}
	public boolean hasOperation() {
		return this.isOperation;
	}
	public java.lang.String getNotEqOperation() {
		return this.notEqOperation;
	}
	public void setNotEqOperation(java.lang.String operation) {
		this.notEqOperation = operation;
		this.isNotEqOperation = true;
	}
	public boolean hasNotEqOperation() {
		return this.isNotEqOperation;
	}
	// IN or notIN
	private List<java.lang.String>	inCriterionOperation;
	private List<java.lang.String>	notInCriterionOperation;
	public void setInOperation(boolean isIn,List<java.lang.String> operations){
		if(isIn){
			inCriterionOperation = operations;
		}else{
			notInCriterionOperation = operations;
		}
	}
	public List<java.lang.String> getInOperation() {
		return inCriterionOperation;
	}
	public List<java.lang.String> getNotInOperation() {
		return notInCriterionOperation;
	}
	
	//Null or NotNull
	private Boolean nullCriterionOperation;
	public void setNullOperation(boolean isNull){
			nullCriterionOperation = isNull;
	}
	public Boolean getNullOperation(){
		return nullCriterionOperation;
	} 
	
	public MatchMode getLikeClassMethod() {
		return this.likeclassMethod;
	}
	public String getLikeClassMethodWithStart() {
		return this.likeClassMethodWithStart;
	}
	public void setLikeClassMethodWithStart(String classMethod) {	
		setClassMethod(classMethod);
		setLikeClassMethod(MatchMode.START);
	}
	public String getLikeClassMethodWithEnd() {
		return this.likeClassMethodWithEnd;
	}
	public void setLikeClassMethodWithEnd(String classMethod) {	
		setClassMethod(classMethod);
		setLikeClassMethod(MatchMode.END);
	}
	public String getLikeClassMethodWithExact() {
		return this.likeClassMethodWithExact;
	}
	public void setLikeClassMethodWithExact(String classMethod) {	
		setClassMethod(classMethod);
		setLikeClassMethod(MatchMode.EXACT);
	}
	public String getLikeClassMethodWithAnywhere() {
		return this.likeClassMethodWithAnywhere;
	}
	public void setLikeClassMethodWithAnywhere(String classMethod) {	
		setClassMethod(classMethod);
		setLikeClassMethod(MatchMode.ANYWHERE);
	}
	private void setLikeClassMethod(MatchMode matchMode) {		
		this.likeclassMethod = matchMode;
	}
	public java.lang.String getClassMethod() {
		return this.classMethod;
	}
	
	public void setClassMethod(java.lang.String value) {		
		this.classMethod = value;
		this.isClassMethod = true;
	}
	public boolean hasClassMethod() {
		return this.isClassMethod;
	}
	public java.lang.String getNotEqClassMethod() {
		return this.notEqClassMethod;
	}
	public void setNotEqClassMethod(java.lang.String classMethod) {
		this.notEqClassMethod = classMethod;
		this.isNotEqClassMethod = true;
	}
	public boolean hasNotEqClassMethod() {
		return this.isNotEqClassMethod;
	}
	// IN or notIN
	private List<java.lang.String>	inCriterionClassMethod;
	private List<java.lang.String>	notInCriterionClassMethod;
	public void setInClassMethod(boolean isIn,List<java.lang.String> classMethods){
		if(isIn){
			inCriterionClassMethod = classMethods;
		}else{
			notInCriterionClassMethod = classMethods;
		}
	}
	public List<java.lang.String> getInClassMethod() {
		return inCriterionClassMethod;
	}
	public List<java.lang.String> getNotInClassMethod() {
		return notInCriterionClassMethod;
	}
	
	//Null or NotNull
	private Boolean nullCriterionClassMethod;
	public void setNullClassMethod(boolean isNull){
			nullCriterionClassMethod = isNull;
	}
	public Boolean getNullClassMethod(){
		return nullCriterionClassMethod;
	} 
	
	public MatchMode getLikeContent() {
		return this.likecontent;
	}
	public String getLikeContentWithStart() {
		return this.likeContentWithStart;
	}
	public void setLikeContentWithStart(String content) {	
		setContent(content);
		setLikeContent(MatchMode.START);
	}
	public String getLikeContentWithEnd() {
		return this.likeContentWithEnd;
	}
	public void setLikeContentWithEnd(String content) {	
		setContent(content);
		setLikeContent(MatchMode.END);
	}
	public String getLikeContentWithExact() {
		return this.likeContentWithExact;
	}
	public void setLikeContentWithExact(String content) {	
		setContent(content);
		setLikeContent(MatchMode.EXACT);
	}
	public String getLikeContentWithAnywhere() {
		return this.likeContentWithAnywhere;
	}
	public void setLikeContentWithAnywhere(String content) {	
		setContent(content);
		setLikeContent(MatchMode.ANYWHERE);
	}
	private void setLikeContent(MatchMode matchMode) {		
		this.likecontent = matchMode;
	}
	public java.lang.String getContent() {
		return this.content;
	}
	
	public void setContent(java.lang.String value) {		
		this.content = value;
		this.isContent = true;
	}
	public boolean hasContent() {
		return this.isContent;
	}
	public java.lang.String getNotEqContent() {
		return this.notEqContent;
	}
	public void setNotEqContent(java.lang.String content) {
		this.notEqContent = content;
		this.isNotEqContent = true;
	}
	public boolean hasNotEqContent() {
		return this.isNotEqContent;
	}
	// IN or notIN
	private List<java.lang.String>	inCriterionContent;
	private List<java.lang.String>	notInCriterionContent;
	public void setInContent(boolean isIn,List<java.lang.String> contents){
		if(isIn){
			inCriterionContent = contents;
		}else{
			notInCriterionContent = contents;
		}
	}
	public List<java.lang.String> getInContent() {
		return inCriterionContent;
	}
	public List<java.lang.String> getNotInContent() {
		return notInCriterionContent;
	}
	
	//Null or NotNull
	private Boolean nullCriterionContent;
	public void setNullContent(boolean isNull){
			nullCriterionContent = isNull;
	}
	public Boolean getNullContent(){
		return nullCriterionContent;
	} 
	
	public MatchMode getLikeClientIp() {
		return this.likeclientIp;
	}
	public String getLikeClientIpWithStart() {
		return this.likeClientIpWithStart;
	}
	public void setLikeClientIpWithStart(String clientIp) {	
		setClientIp(clientIp);
		setLikeClientIp(MatchMode.START);
	}
	public String getLikeClientIpWithEnd() {
		return this.likeClientIpWithEnd;
	}
	public void setLikeClientIpWithEnd(String clientIp) {	
		setClientIp(clientIp);
		setLikeClientIp(MatchMode.END);
	}
	public String getLikeClientIpWithExact() {
		return this.likeClientIpWithExact;
	}
	public void setLikeClientIpWithExact(String clientIp) {	
		setClientIp(clientIp);
		setLikeClientIp(MatchMode.EXACT);
	}
	public String getLikeClientIpWithAnywhere() {
		return this.likeClientIpWithAnywhere;
	}
	public void setLikeClientIpWithAnywhere(String clientIp) {	
		setClientIp(clientIp);
		setLikeClientIp(MatchMode.ANYWHERE);
	}
	private void setLikeClientIp(MatchMode matchMode) {		
		this.likeclientIp = matchMode;
	}
	public java.lang.String getClientIp() {
		return this.clientIp;
	}
	
	public void setClientIp(java.lang.String value) {		
		this.clientIp = value;
		this.isClientIp = true;
	}
	public boolean hasClientIp() {
		return this.isClientIp;
	}
	public java.lang.String getNotEqClientIp() {
		return this.notEqClientIp;
	}
	public void setNotEqClientIp(java.lang.String clientIp) {
		this.notEqClientIp = clientIp;
		this.isNotEqClientIp = true;
	}
	public boolean hasNotEqClientIp() {
		return this.isNotEqClientIp;
	}
	// IN or notIN
	private List<java.lang.String>	inCriterionClientIp;
	private List<java.lang.String>	notInCriterionClientIp;
	public void setInClientIp(boolean isIn,List<java.lang.String> clientIps){
		if(isIn){
			inCriterionClientIp = clientIps;
		}else{
			notInCriterionClientIp = clientIps;
		}
	}
	public List<java.lang.String> getInClientIp() {
		return inCriterionClientIp;
	}
	public List<java.lang.String> getNotInClientIp() {
		return notInCriterionClientIp;
	}
	
	//Null or NotNull
	private Boolean nullCriterionClientIp;
	public void setNullClientIp(boolean isNull){
			nullCriterionClientIp = isNull;
	}
	public Boolean getNullClientIp(){
		return nullCriterionClientIp;
	} 
	
	public java.time.LocalDateTime getCreateTimeBegin() {
		return this.createTimeBegin;
	}
	
	public void setCreateTimeBegin(java.time.LocalDateTime value) {
		this.createTimeBegin = value;
		this.isCreateTimeBegin = true;
	}	
	
	public java.time.LocalDateTime getCreateTimeEnd() {
		return this.createTimeEnd;
	}
	
	public void setCreateTimeEnd(java.time.LocalDateTime value) {
		this.createTimeEnd = value;
		this.isCreateTimeEnd = true;
	}
	public boolean hasCreateTimeBegin() {
		return this.isCreateTimeBegin;
	}
	public boolean hasCreateTimeEnd() {
		return this.isCreateTimeEnd;
	}	
	public java.time.LocalDateTime getCreateTime() {
		return this.createTime;
	}
	
	public void setCreateTime(java.time.LocalDateTime value) {		
		this.createTime = value;
		this.isCreateTime = true;
	}
	public boolean hasCreateTime() {
		return this.isCreateTime;
	}
	public java.time.LocalDateTime getNotEqCreateTime() {
		return this.notEqCreateTime;
	}
	public void setNotEqCreateTime(java.time.LocalDateTime createTime) {
		this.notEqCreateTime = createTime;
		this.isNotEqCreateTime = true;
	}
	public boolean hasNotEqCreateTime() {
		return this.isNotEqCreateTime;
	}
	// IN or notIN
	private List<java.time.LocalDateTime>	inCriterionCreateTime;
	private List<java.time.LocalDateTime>	notInCriterionCreateTime;
	public void setInCreateTime(boolean isIn,List<java.time.LocalDateTime> createTimes){
		if(isIn){
			inCriterionCreateTime = createTimes;
		}else{
			notInCriterionCreateTime = createTimes;
		}
	}
	public List<java.time.LocalDateTime> getInCreateTime() {
		return inCriterionCreateTime;
	}
	public List<java.time.LocalDateTime> getNotInCreateTime() {
		return notInCriterionCreateTime;
	}
	
	//Null or NotNull
	private Boolean nullCriterionCreateTime;
	public void setNullCreateTime(boolean isNull){
			nullCriterionCreateTime = isNull;
	}
	public Boolean getNullCreateTime(){
		return nullCriterionCreateTime;
	} 
	
	private List<String> listOrderAsc = new ArrayList<>();
	private List<String> listOrderDesc = new ArrayList<>();

	public void setOrderAsc(String fdName) {
		listOrderAsc.add(fdName);
	}

	public void setOrderDec(String fdName) {
		listOrderDesc.add(fdName);
	}

	public List<String> getOrderAscList() {
		return listOrderAsc;
	}

	public List<String> getOrderDecList() {
		return listOrderDesc;
	}
	
	
	/**
	 * 获取查询条件
	 */
	public Specification<SysLog> createSpecification() {
		Specification<SysLog> example = (root, query, criteriaBuilder) -> {
			List<Order> orders = new ArrayList<>();
			for (String asc : this.getOrderAscList()) {
				orders.add(criteriaBuilder.asc(root.get(asc)));
			}
			for (String desc : this.getOrderDecList()) {
				orders.add(criteriaBuilder.desc(root.get(desc)));
			}
			query.orderBy(orders);
			List<Predicate> predicates = createQuery(root, this, criteriaBuilder);
			hookQuery(root, criteriaBuilder,predicates);
			return query.where(predicates.toArray(new Predicate[predicates.size()])).getRestriction();
		};
		return example;
	}
	/**
	 * <p>
	 * <p>自定义的方法时候实现此方法即可(内部类方式使用即可)
	 * <p>使用方法: predicates.add(criteriaBuilder.equal(root.get("biaoqian").as(String.class), "value"));
	 * @param root
	 * @param query
	 * @param criteriaBuilder
	 * @param predicates
	 */
	public void hookQuery(Root<SysLog> root, CriteriaBuilder criteriaBuilder,List<Predicate> predicates) {}
	/**
	 * 组装query对象
	 * 
	 * @param root
	 * @param SysLogQuery
	 * @param criteriaBuilder
	 * @return
	 */
	private List<Predicate> createQuery(Root<SysLog> root, SysLogQuery query, CriteriaBuilder criteriaBuilder) {
		List<Predicate> predicates = new ArrayList<Predicate>();
		/**
		 * idExpression
		 */
		Expression<java.lang.Integer> idExpression = root.get(SysLog.PROP_ID).as(java.lang.Integer.class);
		if (query.hasId()) {
			java.lang.Integer value = query.getId();
			if( value != null){
				predicates.add(criteriaBuilder.equal(idExpression, value));					
			}
		}
		if (query.hasNotEqId()) {
			java.lang.Integer value = query.getNotEqId();
			predicates.add(criteriaBuilder.notEqual(idExpression, value));
		}
		
		if(query.getLeId()!=null){
			predicates.add(criteriaBuilder.le(idExpression, query.getLeId()));
		}
		if(query.getGeId()!=null){
			predicates.add(criteriaBuilder.ge(idExpression, query.getGeId()));
		}
		if(query.getLtId()!=null){
			predicates.add(criteriaBuilder.lt(idExpression, query.getLtId()));
		}
		if(query.getGtId()!=null){
			predicates.add(criteriaBuilder.gt(idExpression, query.getGtId()));
		}
		
		if (query.getInId() != null) {
			predicates.add(idExpression.in(query.getInId()));
		}
		if (query.getNotInId() != null) {
			predicates.add(criteriaBuilder.not(idExpression.in(query.getInId())));
		}
		if (query.getNullId() != null) {
			if (query.getNullId()) {
				predicates.add(criteriaBuilder.isNull(idExpression));
			} else {
				predicates.add(criteriaBuilder.isNotNull(idExpression));
			}
		}
		/**
		 * usernameExpression
		 */
		Expression<java.lang.String> usernameExpression = root.get(SysLog.PROP_USERNAME).as(java.lang.String.class);
		if (query.hasUsername()) {
			java.lang.String value = query.getUsername();
			if (query.getLikeUsername() != null) {
				predicates.add(criteriaBuilder.like(usernameExpression, query.getLikeUsername().toMatchString(value)));
			} else {
				predicates.add(criteriaBuilder.equal(usernameExpression, value));
			}
		}
		if (query.hasNotEqUsername()) {
			java.lang.String value = query.getNotEqUsername();
			predicates.add(criteriaBuilder.notEqual(usernameExpression, value));
		}
		
		if (query.getInUsername() != null) {
			predicates.add(usernameExpression.in(query.getInUsername()));
		}
		if (query.getNotInUsername() != null) {
			predicates.add(criteriaBuilder.not(usernameExpression.in(query.getInUsername())));
		}
		if (query.getNullUsername() != null) {
			if (query.getNullUsername()) {
				predicates.add(criteriaBuilder.isNull(usernameExpression));
			} else {
				predicates.add(criteriaBuilder.isNotNull(usernameExpression));
			}
		}
		/**
		 * roleNameExpression
		 */
		Expression<java.lang.String> roleNameExpression = root.get(SysLog.PROP_ROLE_NAME).as(java.lang.String.class);
		if (query.hasRoleName()) {
			java.lang.String value = query.getRoleName();
			if (query.getLikeRoleName() != null) {
				predicates.add(criteriaBuilder.like(roleNameExpression, query.getLikeRoleName().toMatchString(value)));
			} else {
				predicates.add(criteriaBuilder.equal(roleNameExpression, value));
			}
		}
		if (query.hasNotEqRoleName()) {
			java.lang.String value = query.getNotEqRoleName();
			predicates.add(criteriaBuilder.notEqual(roleNameExpression, value));
		}
		
		if (query.getInRoleName() != null) {
			predicates.add(roleNameExpression.in(query.getInRoleName()));
		}
		if (query.getNotInRoleName() != null) {
			predicates.add(criteriaBuilder.not(roleNameExpression.in(query.getInRoleName())));
		}
		if (query.getNullRoleName() != null) {
			if (query.getNullRoleName()) {
				predicates.add(criteriaBuilder.isNull(roleNameExpression));
			} else {
				predicates.add(criteriaBuilder.isNotNull(roleNameExpression));
			}
		}
		/**
		 * operationExpression
		 */
		Expression<java.lang.String> operationExpression = root.get(SysLog.PROP_OPERATION).as(java.lang.String.class);
		if (query.hasOperation()) {
			java.lang.String value = query.getOperation();
			if (query.getLikeOperation() != null) {
				predicates.add(criteriaBuilder.like(operationExpression, query.getLikeOperation().toMatchString(value)));
			} else {
				predicates.add(criteriaBuilder.equal(operationExpression, value));
			}
		}
		if (query.hasNotEqOperation()) {
			java.lang.String value = query.getNotEqOperation();
			predicates.add(criteriaBuilder.notEqual(operationExpression, value));
		}
		
		if (query.getInOperation() != null) {
			predicates.add(operationExpression.in(query.getInOperation()));
		}
		if (query.getNotInOperation() != null) {
			predicates.add(criteriaBuilder.not(operationExpression.in(query.getInOperation())));
		}
		if (query.getNullOperation() != null) {
			if (query.getNullOperation()) {
				predicates.add(criteriaBuilder.isNull(operationExpression));
			} else {
				predicates.add(criteriaBuilder.isNotNull(operationExpression));
			}
		}
		/**
		 * classMethodExpression
		 */
		Expression<java.lang.String> classMethodExpression = root.get(SysLog.PROP_CLASS_METHOD).as(java.lang.String.class);
		if (query.hasClassMethod()) {
			java.lang.String value = query.getClassMethod();
			if (query.getLikeClassMethod() != null) {
				predicates.add(criteriaBuilder.like(classMethodExpression, query.getLikeClassMethod().toMatchString(value)));
			} else {
				predicates.add(criteriaBuilder.equal(classMethodExpression, value));
			}
		}
		if (query.hasNotEqClassMethod()) {
			java.lang.String value = query.getNotEqClassMethod();
			predicates.add(criteriaBuilder.notEqual(classMethodExpression, value));
		}
		
		if (query.getInClassMethod() != null) {
			predicates.add(classMethodExpression.in(query.getInClassMethod()));
		}
		if (query.getNotInClassMethod() != null) {
			predicates.add(criteriaBuilder.not(classMethodExpression.in(query.getInClassMethod())));
		}
		if (query.getNullClassMethod() != null) {
			if (query.getNullClassMethod()) {
				predicates.add(criteriaBuilder.isNull(classMethodExpression));
			} else {
				predicates.add(criteriaBuilder.isNotNull(classMethodExpression));
			}
		}
		/**
		 * contentExpression
		 */
		Expression<java.lang.String> contentExpression = root.get(SysLog.PROP_CONTENT).as(java.lang.String.class);
		if (query.hasContent()) {
			java.lang.String value = query.getContent();
			if (query.getLikeContent() != null) {
				predicates.add(criteriaBuilder.like(contentExpression, query.getLikeContent().toMatchString(value)));
			} else {
				predicates.add(criteriaBuilder.equal(contentExpression, value));
			}
		}
		if (query.hasNotEqContent()) {
			java.lang.String value = query.getNotEqContent();
			predicates.add(criteriaBuilder.notEqual(contentExpression, value));
		}
		
		if (query.getInContent() != null) {
			predicates.add(contentExpression.in(query.getInContent()));
		}
		if (query.getNotInContent() != null) {
			predicates.add(criteriaBuilder.not(contentExpression.in(query.getInContent())));
		}
		if (query.getNullContent() != null) {
			if (query.getNullContent()) {
				predicates.add(criteriaBuilder.isNull(contentExpression));
			} else {
				predicates.add(criteriaBuilder.isNotNull(contentExpression));
			}
		}
		/**
		 * clientIpExpression
		 */
		Expression<java.lang.String> clientIpExpression = root.get(SysLog.PROP_CLIENT_IP).as(java.lang.String.class);
		if (query.hasClientIp()) {
			java.lang.String value = query.getClientIp();
			if (query.getLikeClientIp() != null) {
				predicates.add(criteriaBuilder.like(clientIpExpression, query.getLikeClientIp().toMatchString(value)));
			} else {
				predicates.add(criteriaBuilder.equal(clientIpExpression, value));
			}
		}
		if (query.hasNotEqClientIp()) {
			java.lang.String value = query.getNotEqClientIp();
			predicates.add(criteriaBuilder.notEqual(clientIpExpression, value));
		}
		
		if (query.getInClientIp() != null) {
			predicates.add(clientIpExpression.in(query.getInClientIp()));
		}
		if (query.getNotInClientIp() != null) {
			predicates.add(criteriaBuilder.not(clientIpExpression.in(query.getInClientIp())));
		}
		if (query.getNullClientIp() != null) {
			if (query.getNullClientIp()) {
				predicates.add(criteriaBuilder.isNull(clientIpExpression));
			} else {
				predicates.add(criteriaBuilder.isNotNull(clientIpExpression));
			}
		}
		/**
		 * createTimeExpression
		 */
		Expression<java.time.LocalDateTime> createTimeExpression = root.get(SysLog.PROP_CREATE_TIME).as(java.time.LocalDateTime.class);
		if(query.hasCreateTimeBegin() && query.getCreateTimeBegin()!= null){
			if(!query.hasCreateTimeEnd() || query.getCreateTimeEnd() == null){
				predicates.add(criteriaBuilder.greaterThan(createTimeExpression, query.getCreateTimeBegin()));
			}else{
				predicates.add(criteriaBuilder.between(createTimeExpression, query.getCreateTimeBegin(), query.getCreateTimeEnd()));
			}			
		}
		if(query.hasCreateTimeEnd() && query.getCreateTimeEnd()!=null){
			if(!query.hasCreateTimeBegin() || query.getCreateTimeBegin() == null){
				predicates.add(criteriaBuilder.lessThan(createTimeExpression, query.getCreateTimeBegin()));
			}
		}							
		if (query.hasCreateTime()) {
			java.time.LocalDateTime value = query.getCreateTime();
			if( value != null){
				predicates.add(criteriaBuilder.equal(createTimeExpression, value));					
			}
		}
		if (query.hasNotEqCreateTime()) {
			java.time.LocalDateTime value = query.getNotEqCreateTime();
			predicates.add(criteriaBuilder.notEqual(createTimeExpression, value));
		}
		
		if (query.getInCreateTime() != null) {
			predicates.add(createTimeExpression.in(query.getInCreateTime()));
		}
		if (query.getNotInCreateTime() != null) {
			predicates.add(criteriaBuilder.not(createTimeExpression.in(query.getInCreateTime())));
		}
		if (query.getNullCreateTime() != null) {
			if (query.getNullCreateTime()) {
				predicates.add(criteriaBuilder.isNull(createTimeExpression));
			} else {
				predicates.add(criteriaBuilder.isNotNull(createTimeExpression));
			}
		}
		return predicates;
	}
	public String toString() {
		return ToStringBuilder.reflectionToString(this,ToStringStyle.MULTI_LINE_STYLE);
	}
	
}

